	//新浪微博分享接口
	
	$('#weibo').click(function(){
		var mes = returnMessage();
		window.sharetitle = mes.title;
		window.shareUrl = mes.urls;
		share();
	});
	function share(){
		//d指的是window
		(function(s,d,e){try{}catch(e){}var f='http://v.t.sina.com.cn/share/share.php?',u=d.location.href,p=['url=',e(u),'&title=',e(window.sharetitle),'&appkey=2924220432','&pic=',e(window.shareUrl)].join('');function a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=620,height=450,left=',(s.width-620)/2,',top=',(s.height-450)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})(screen,document,encodeURIComponent);
	}
	
	//人人网分享接口
	$("#renren").click(function(){
		shareClick()
	})
	function shareClick() {
		var mes = returnMessage()
		var rrShareParam = {
			resourceUrl : mes.urls,	//分享的资源Url
			srcUrl : mes.urls,	//分享的资源来源Url,默认为header中的Referer,如果分享失败可以调整此值为resourceUrl试试
			pic : mes.urls,		//分享的主题图片Url
			title : mes.title,		//分享的标题
			description : mes.title	//分享的详细描述
		};
		rrShareOnclick(rrShareParam);
	}
	
	//腾讯分享链接
	$("#tweibo").click(function(){
		shareTweibo()
	})
	function shareTweibo(){
		var mes = returnMessage()
		var _appkey = '333cf198acc94876a684d043a6b48e14';
		var _site = encodeURI; 
		var _pic = ''; 
		var _u = 'http://v.t.qq.com/share/share.php?title='+mes.title+'&url='+mes.urls+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic; 
		window.open( _u,'转播到腾讯微博', 'width=700, height=580, top=180, left=320, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' ); 
	};
	
	//分享到qq空间
	$("#qzone").click(function(){
		shareQZone()
	})
	function shareQZone(){
		window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(document.location.href));
	}
	
	//分享到豆瓣
	$("#douban").click(function(){
		shareDouban()
	})
	function shareDouban(){
		var d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:'',r='http://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1',x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&r=1'};
		if(/Firefox/.test(navigator.userAgent))
		{
			setTimeout(x,0)
			}
		else{
			x()
			}
		}
	

//返回当前页面的title跟url
function returnMessage(){
	console.log(document.title+"+"+window.location.href)
	return {
		title:document.title,
		urls:window.location.href
	}
}

